<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    new Promise((resolve, reject) => {
        console.log('开始请求A数据......')
        try {
          // throw new Error('A数据请求失败')
          setTimeout(() => {
            console.log('A数据请求成功')
            resolve({
              user: 'laoliu'
            })
          }, 2000)
        } catch (e) {
          reject(e.message)
        }
      })

      .then((value) => {
        return new Promise((resolve, reject) => {
          console.log('开始请求B数据......')
          try {
            // throw new Error('B数据请求失败')
            setTimeout(() => {
              console.log('B数据请求成功')
              const age = {
                age: '19'
              }
              resolve({
                ...value,
                ...age
              })
            }, 2000)
          } catch (e) {
            reject(e.message)
          }
        })
      })

      .then((value) => {
        return new Promise((resolve, reject) => {
          console.log('开始请求C数据......')
          try {
            // throw new Error('C数据请求失败')
            setTimeout(() => {
              console.log('C数据请求成功')
              const sex = {
                sex: '19'
              }
              resolve({
                ...value,
                ...sex
              })
            }, 2000)
          } catch (e) {
            reject(e.message)
          }
        })
      })

      .then((value) => {
        console.log(value);
      })
  </script>
</body>

</html>